class WackCarPawn extends UTPawn
	placeable config(Game);

var(Pathfinding) public array<Actor> PathTargets;
var public vector PathPos;
var() bool FreezePawn;
var() WhackCar Car;
var() int Ammo;
var() int selectedWeapon;
var() int carSpeed;

simulated function PostBeginPlay()
{
	super.PostBeginPlay();	
	PathPos = PathTargets[0].Location;
	spawnvehicle();
	 `log("-------------> POST BEING PLAY W ENEMYPAWN");
}

function spawnvehicle()
{
    local vector loc;
	 `log("-------------> JEST W SPAWNVEHICLE()");
    loc = self.Location;
    loc += vect(100,100,100);//need to shift the vehicle so it doesn't crush people --- this can be adjusted as necessary
	
    //Change the class to your extended vehicle or to scorp_content
    Car = Spawn(class'WhackCar',,,loc, self.Rotation);
    if (Car != NONE)
    {
        if (Car != NONE && Car.TryToDrive(self))
        {
            return;
        }
	
        	 `log("-------------> ATTACHING DRIVER TO ENEMYCAR");
        Car.AttachDriver(self);
    }
}

event Tick(float delra)
{
	if(Car != none)
	{
		Car.FreezePawn = FreezePawn;
		Car.SetSpeed(carSpeed);
		Ammo = Car.Ammo;
		selectedWeapon = Car.selectedWeapon;
	}
}

DefaultProperties
{
	bScriptTickSpecial = false;
	ControllerClass= class'WhackCarAi'
	FreezePawn = true
	//PathPos = (x=0,y=0,z=0)
	Begin Object Class=SpriteComponent Name=Sprite
		Sprite=Texture2D'EditorResources.Corpse'
		HiddenGame=True
		AlwaysLoadOnClient=False
		AlwaysLoadOnServer=False
		SpriteCategoryName="PrisonersGame"
	End Object
	Components.Add(Sprite)
}

